<template>
    <div>
    <!-- 轮播图区域 -->
        <mt-swipe :auto="4000">
            <mt-swipe-item v-for="(item, index) in lunbotuList" :key="index">
                <img :src="item.img">
            </mt-swipe-item>
        </mt-swipe>
        <!-- 九宫格区域 -->
        <ul class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/home/newsList">
                    <img class="mui-icon mui-icon-home" src='../assets/img/menu1.png'></img>
                    <div class="mui-media-body">新闻资讯</div>
                </router-link></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
                    <img class="mui-icon mui-icon-email"src='../assets/img/menu2.png'></img>
                    <div class="mui-media-body">Email</div>
                </a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
                    <img class="mui-icon mui-icon-chatbubble" src='../assets/img/menu3.png'></img>
                    <div class="mui-media-body">Chat</div>
                </a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
                    <img class="mui-icon mui-icon-location" src='../assets/img/menu4.png'></img>
                    <div class="mui-media-body">location</div>
                </a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
                    <img class="mui-icon mui-icon-search" src='../assets/img/menu5.png'></img>
                    <div class="mui-media-body">Search</div>
                </a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
                    <img class="mui-icon mui-icon-phone" src='../assets/img/menu6.png'></img>
                    <div class="mui-media-body">Phone</div>
                </a></li>
        </ul>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                lunbotuList: []
            }
        },
        created() {
            this.getlunbotu()
        },
        methods: {
            getlunbotu() {
                //获取轮播图的方法
                this.axios.get('/api/getlunbo').then(reslult => {
                    // console.log(reslult)
                    if (reslult.data.status === 0) {
                        this.lunbotuList = reslult.data.message
                    } else {
                        Toast('图片加载失败')
                    }
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
    .mint-swipe {
        height: 200px;
        .mint-swipe-item {
            &:nth-child(1) {
                background-color: red;
            }
            &:nth-child(2) {
                background-color: aqua;
            }
            &:nth-child(3) {
                background-color: saddlebrown;
            }
        }
        img {
            width: 100%;
            height: 100%;
        }
    }
    
    .mui-table-view-cell {
        img {
            width: 60px;
            height: 60px;
        }
    }
    
    .mui-grid-view.mui-grid-9 .mui-table-view-cell {
        border: 0;
    }
    
    .mui-grid-view.mui-grid-9 {
        background-color: #fff;
    }
</style>